package com.skt.result;

import lombok.Data;
import java.util.List;

@Data
public class PageResult<T> {
    private long pageNum;
    private long pageSize;
    private long total;
    private List<T> list;

    // 老代码依赖的构造函数（必须保留）
    public PageResult(long pageNum, long pageSize, long total, List<T> list) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
        this.list = list;
    }

    // 新增：完整参数的静态工厂方法（推荐使用）
    public static <T> PageResult<T> success(long pageNum, long pageSize, long total, List<T> data) {
        return new PageResult<>(pageNum, pageSize, total, data);
    }
}